# def hello():
#       print("Hello World!")

# hello()

# def max(a,b):
#       if a > b:
#             return a
#       else:
#             return b

# a = 4
# b = 5

# print(max(a,b))

# def area(width,height):
#       return width * height

# def print_welcome(name):
#       print("Welcome",name)

# print_welcome("Runoob")

# w = 4
# h = 5

# print("width = ",w," height = ",h," area = ",area(w,h))

# def printme(str):
#       print(str)
#       return

# printme("我要调用用户自定义函数！")
# printme("再次调用一次函数")

# id()函数查看内存地址的变化
# 传不可变对象实例
# def change(a):
#       print(id(a))
#       a = 10
#       print(id(a))

# a = 1
# print(id(a))
# change(a)

# def changeMe(myList):
#       myList.append([1,2,3,4])
#       print("函数内取值：",myList)

# myList = [10,20,30]
# changeMe(myList)
# print("函数外取值：",myList)

# def printInfo(arg1,*vartuple):
#       print("输出：")
#       print(arg1)
#       print(vartuple)

# printInfo(70,60,50)

# def printInfo(arg1,*vartuple):
#       print("输出：")
#       print(arg1)
#       for var in vartuple:
#             print(var)
#       return

# printInfo(10)

# printInfo(20,30,50)

# def printInfo(arg1,**vardict):
#       print("输出：")
#       print(arg1)
#       print(vardict)

# printInfo(1,a=2,b=3)

x = lambda a: a + 10

print(x(5))

sum = lambda arg1,arg2: arg1 + arg2

print("10与20相加后的值为：",sum(10,20))
print("20与30相加后的值为：",sum(20,30))

# 匿名函数封装在函数内
def myfunc(n):
      return lambda a : a * n

mydoubler = myfunc(2)
mytripler = myfunc(3)

print(mydoubler(11))
print(mytripler(11))